package com.mipo.client.javase.j2se.accesscontroller;

import java.io.FilePermission;
import java.security.AccessController;
import java.security.Permission;
import java.security.PrivilegedAction;

public class Client {
	public void doCheck() {
		AccessController.doPrivileged(new PrivilegedAction() {
			public Object run() {
				check();
				return null;
			}
		});
	}

	private void check() {
		Permission perm = new FilePermission("G:/project/LunaMavneJdk7A/src/main/java/com/mipo/accesscontroller/1.txt", "read");
		AccessController.checkPermission(perm);
		System.out.println(" TestService has permission ");
	}
}
